package annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by Administrator on 2017/10/24 024.
 */
public class Demo1
{
    public static void main(String[] args)
    {
        test(() ->{});
    }

    public static void test(Face1 f)
    {
        System.out.println("调用成功");
    }

    @MyAno(name = "hr", age = 1)
    public void annoTest()
    {

    }

    @FunctionalInterface
    public interface Face1
    {
        void method();

//        void method2();只能定义抽象方法
    }

    @Retention(value = RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface MyAno
    {
        String name() default "who";
        int age() default 0;
    }
}
